home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_tiki1statue.cog < prev    next >
Text File  |  1999-11-15  |  29KB  |  994 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_Tiki1Statue.cog
  4. #
  5. # tikikey2 = 99
  6. #
  7. # columnLift = statue
  8. # columnBock = base
  9. #
  10. # [TRM]
  11. #
  12. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  13. #
  14. # ========================================================================================
  15.  
  16. symbols
  17.  
  18.     message     startup
  19.     message     activated
  20.     message     blocked
  21.     
  22.     # ** misc local stuff **
  23.     thing       player          local
  24.     thing       indy            local
  25.     thing       tikiStatic      local
  26.     
  27.     # ** buttons **
  28.     thing       button1
  29.     thing       button2
  30.     thing       button3
  31.     thing       button4
  32.     
  33.     # ** statue **
  34.     thing       base
  35.     thing       statue
  36.     thing       tiki
  37.     
  38.     # ** cameras **
  39.     thing       but1Cam
  40.     thing       but2Cam
  41.     thing       but3Cam
  42.     thing       but4Cam    
  43.     thing       holeCam
  44.     
  45.     # ** targets **
  46.     thing       camTargPos1
  47.     thing       camTargPos2
  48.     thing       camTargPos3
  49.     thing       camTargPos4
  50.     thing       target1
  51.     
  52.     # ** button cam targets **
  53.     thing       but1MoveTarg        local
  54.     thing       but2MoveTarg        local
  55.     thing       but3MoveTarg        local
  56.     thing       but4MoveTarg        local
  57.     
  58.     # ** walk targets **
  59.     thing       but1_walkTarg
  60.     thing       but2_walkTarg
  61.     thing       but3_walkTarg
  62.     thing       but4_walkTarg
  63.     
  64.     # ** misc **
  65.     thing       columnBase
  66.     thing       columnHooks
  67.     
  68.     # ** templates **
  69.     template    tplActor=indy_sh_actor          local
  70.     
  71.     # ** keys **
  72.     keyframe    inReach=in_pickup.key            local
  73.     
  74.     cog         talkCog         local
  75.     cog         cameraShake
  76.     cog         hint_Cog
  77.     
  78.     # ** voice lines **
  79.     sound       inWhat=Inxj007.wav              local   # whoa!
  80.     sound        in_Line0=Inxj098.wav            local   # It won't budge.
  81.     sound       say_Tiki=tm03j03a.wav           local   # a tiki statue...
  82.     
  83.     # ** raise/lower sounds **
  84.     sound       snd_MoveStart=nub_weight_start_c.wav    local
  85.     sound       snd_MoveMove=nub_weight_move_c.wav      local
  86.     sound       snd_MoveStop=nub_weight_stop_c.wav      local
  87.     
  88.     # ** rotate sounds **
  89.     sound       snd_RotateStart=olv_quetzdoor_start_c.wav   local
  90.     sound       snd_RotateMove=olv_quetzdoor_move_c.wav     local
  91.     sound       snd_RotateStop=olv_quetzdoor_stop_c.wav     local
  92.     
  93.     # ** subroutines **
  94.     flex        but1Push        local
  95.     flex        but2Push        local
  96.     flex        but3Push        local
  97.     flex        but4Push        local
  98.     flex        getTiki         local
  99.     flex        speak           local
  100.     
  101.     # ** ints **
  102.     int         done=0          local
  103.     int         playing=0       local
  104.     int         gotIt=0         local
  105.     
  106.     int         but1_Ready=1        local
  107.     int         but2_Ready=1        local
  108.     int         but3_Ready=0        local
  109.     int         but4_Ready=0        local
  110.     
  111.     int         loopSound           local
  112.     int         rotSound            local
  113.     int         curCam              local
  114.     
  115.     int         statue_Pos=0        local
  116.     int         base_Pos=0          local
  117.     
  118.     int         tiki_Moved=0         local
  119.     int         tiki_Locked=0       local
  120.     int         tiki_Released=0     local
  121.     int         tiki_CanLower=0     local
  122.     
  123. end
  124.  
  125. # ========================================================================================
  126.  
  127. code
  128.  
  129. startup:
  130.  
  131.     player = GetLocalPlayerThing();
  132.     
  133.     SetThingLight(base, '0.8 0.7 0.7', 0.001, 0.1);
  134.     SetThingLight(statue, '0.8 0.7 0.7', 0.001, 0.1);
  135.     SetThingLight(tiki, '0.5 0.5 0.3', 0.001, 0.1);
  136.     SetThingLight(columnBase, '0.5 0.5 0.3', 0.001, 0.1);
  137.     SetThingLight(columnHooks, '0.3 0.3 0.2', 0.001, 0.1);
  138.     
  139.     SetCollideType(columnHooks, 0);
  140.     
  141.     return;
  142.  
  143. # ========================================================================================
  144.  
  145. activated:
  146.     
  147.     curCam = GetCurrentCamera();
  148.     
  149.     if((GetSenderRef() == button1) && (playing == 0))
  150.     {
  151.         playing = 1;
  152.         Call but1Push;
  153.     }
  154.         
  155.     if((GetSenderRef() == button2) && (playing == 0))
  156.     {
  157.         playing = 1;
  158.         Call but2Push;
  159.     }
  160.     
  161.     if((GetSenderRef() == button3) && (playing == 0))
  162.     {
  163.         playing = 1;
  164.         Call but3Push;
  165.     }
  166.  
  167.     if((GetSenderRef() == button4) && (playing == 0))
  168.     {
  169.         playing = 1;
  170.         Call but4Push;
  171.     }
  172.     
  173.     if((GetSenderRef() == tiki) && (gotIt == 0))
  174.     {
  175.         gotIt = 1;
  176.         Call getTiki;
  177.     }
  178.  
  179. return;
  180.  
  181. # ========================================================================================
  182.  
  183. but1Push:
  184.  
  185.     # do cutscene stuff
  186.     MakeMeStop();
  187.     StartCutscene(2);
  188.     
  189.     # offset camera
  190.     SetExtCamLookOffsetToThing(player);
  191.     SetExtCamOffsetToThing(but1Cam);
  192.     
  193.     # put away any weapon
  194.     DeselectWeaponWait(player);
  195.     
  196.     # statue is in proper position, move it
  197.     if(but1_Ready == 1)
  198.     {
  199.         # push in button1
  200.         PlayMode(player, 60, 0);
  201.         Sleep(0.3);
  202.         MoveToFrame(button1, 1, 1.0);
  203.         WaitForStop(button1);
  204.         Sleep(0.5);
  205.         
  206.         # switch to but1Cam
  207.         SetCameraFocus(2, but1Cam);
  208.         SetCameraSecondaryFocus(2, player);
  209.         SetCurrentCamera(2);
  210.         SetCameraFOV(90, 0, 0.0);
  211.         
  212.         # create indy actor
  213.         indy = CreateThing(tplActor, player);
  214.         CaptureThing(indy);
  215.         SetCollideType(indy, 0);
  216.         
  217.         # outfit indy actor
  218.         CopyPlayerHolsters(player, indy);
  219.         
  220.         # hide player show indy
  221.         SetThingFlags(player, 0x80000);
  222.         ClearThingFlags(indy, 0x80000);
  223.         
  224.         # set camera interp speed turn on look interp
  225.         SetCameraInterpSpeed(2, 2.0);
  226.         SetCameraLookInterp(2, 1);
  227.         Sleep(0.01);
  228.         
  229.         # interp to camTargPos1 (looking at statue)
  230.         SetCameraSecondaryFocus(2, camTargPos1);
  231.         
  232.         # indy looks at statue
  233.         AISetLookThing(indy, camTargPos1);
  234.         
  235.         # walk indy closer to statue
  236.         AISetMoveSpeed(indy, 1.0);
  237.         AISetLookThing(indy, but1_walkTarg);
  238.         AISetMoveThing(indy, but1_walkTarg, 0);
  239.  
  240.         # remove collisions
  241.         SetCollideType(statue, 0);
  242.         SetCollideType(base, 0);
  243.         SetCollideType(columnBase, 0);
  244.         Sleep(0.01);
  245.         
  246.         # play move sound fx
  247.         PlaySoundThing(snd_MoveStart, base, 1.0, 15.0, 25.0, 0);
  248.         loopSound = PlaySoundThing(snd_MoveMove, base, 1.0, 15.0, 25.0, 1);
  249.             
  250.         # raise statue to pos 1
  251.         if((statue_Pos == 0) && (base_Pos == 0))
  252.         {
  253.             MoveThingToPos(statue, VectorAdd(GetThingPos(statue), '0.0 0.0 0.5'), 3.0);
  254.             if(tiki_Moved == 1) MoveThingToPos(tiki, VectorAdd(GetThingPos(tiki), '0.0 0.0 0.5'), 3.0);
  255.             statue_Pos = 1;
  256.             but3_Ready = 1;
  257.         }
  258.         
  259.         # lower statue to pos 0
  260.         else if((statue_Pos == 1) && (base_Pos == 0))
  261.         {
  262.             MoveThingToPos(statue, VectorAdd(GetThingPos(statue), '0.0 0.0 -0.5'), 3.0);
  263.             if(tiki_Moved == 1) MoveThingToPos(tiki, VectorAdd(GetThingPos(tiki), '0.0 0.0 -0.5'), 3.0);
  264.             statue_Pos = 0;
  265.             but3_Ready = 0;
  266.         }
  267.         
  268.         # lower statue to pos 1 inside base
  269.         else if((statue_Pos == 2) && (base_Pos == 1))
  270.         {
  271.             MoveThingToPos(statue, VectorAdd(GetThingPos(statue), '0.0 0.0 -0.5'), 3.0);
  272.             if(tiki_Moved == 1) MoveThingToPos(tiki, VectorAdd(GetThingPos(tiki), '0.0 0.0 -0.5'), 3.0);
  273.             statue_Pos = 1;
  274.             tiki_Locked = 0;
  275.             but2_Ready = 0;
  276.             but3_Ready = 0;
  277.             but4_Ready = 0;
  278.         }
  279.         
  280.         # raise statue to pos 2 from inside base
  281.         else if((statue_Pos == 1) && (base_Pos == 1))
  282.         {
  283.             if((tiki_Moved == 1) && (tiki_Released == 0))
  284.             {
  285.                 # play rotate sound fx
  286.                 PlaySoundThing(snd_RotateStart, tiki, 1.0, 15.0, 25.0, 0);
  287.                 rotSound = PlaySoundThing(snd_RotateMove, tiki, 1.0, 15.0, 25.0, 1);
  288.                 Rotate(tiki, 90, 1, 3.0);
  289.                 Rotate(statue, 90, 1, 3.0);
  290.                 WaitForStop(tiki);
  291.                 StopSound(rotSound, 0.0);
  292.                 PlaySoundThing(snd_RotateStop, statue, 1.0, 15.0, 25.0, 0);
  293.                 tiki_Released = 1;
  294.             }
  295.             
  296.             MoveThingToPos(statue, VectorAdd(GetThingPos(statue), '0.0 0.0 0.5'), 3.0);
  297.             if(tiki_Moved == 1) MoveThingToPos(tiki, VectorAdd(GetThingPos(tiki), '0.0 0.0 0.5'), 3.0);
  298.             statue_Pos = 2;
  299.             tiki_Locked = 1;
  300.             but3_Ready = 1;
  301.             but4_Ready = 1;
  302.         }
  303.         
  304.         Sleep(3.0);
  305.         StopSound(loopSound, 0.0);
  306.         PlaySoundThing(snd_MoveStop, base, 1.0, 15.0, 25.0, 0);
  307.         
  308.         # restore collisions
  309.         SetCollideType(statue, 3);
  310.         SetCollideType(base, 3);
  311.         SetCollideType(columnBase, 3);
  312.             
  313.         MoveToFrame(button1, 0, 1.0);
  314.  
  315.         # Get the player into position
  316.         ResetThing(player);
  317.         CopyOrientAndPos(indy, player);
  318.         
  319.         # hide actor show player
  320.         SetThingFlags(indy, 0x80000);
  321.         ClearThingFlags(player, 0x80000);
  322.         DestroyThing(indy);
  323.         
  324.         # restore camera to player
  325.         SetCameraPosition(1, GetThingPos(but1Cam));
  326.         SetCurrentCamera(1);
  327.         RestoreExtCam();
  328.         
  329.         # turn off look interp
  330.         SetCameraLookInterp(2, 0);
  331.     }
  332.     
  333.     # statue can't be moved
  334.     else
  335.     {
  336.         # push in button1
  337.         PlayMode(player, 60, 0);
  338.         Call speak;
  339.         
  340.         # restore camera to player
  341.         SetCameraPosition(1, GetThingPos(but1Cam));
  342.         SetCurrentCamera(1);
  343.         RestoreExtCam();
  344.     }
  345.     
  346.     # restore controls
  347.     ClearActorFlags(player, 0x200000);
  348.     EndCutscene();
  349.     
  350.     playing = 0;
  351.     
  352.     return;
  353.  
  354. # ========================================================================================
  355.  
  356. but2Push:
  357.  
  358.     # do cutscene stuff
  359.     MakeMeStop();
  360.     StartCutscene(2);
  361.     
  362.     # offset camera
  363.     SetExtCamLookOffsetToThing(player);
  364.     SetExtCamOffsetToThing(but2Cam);
  365.     
  366.     # put away any weapon
  367.     DeselectWeaponWait(player);
  368.     
  369.     # statue is in proper position, move it
  370.     if(but2_Ready == 1)
  371.     {
  372.         # push in button2
  373.         PlayMode(player, 60, 0);
  374.         Sleep(0.3);
  375.         MoveToFrame(button2, 1, 1.0);
  376.         WaitForStop(button2);
  377.         Sleep(0.5);
  378.         
  379.         # Switch to but2Cam
  380.         SetCameraFocus(2, but2Cam);
  381.         SetCameraSecondaryFocus(2, player);
  382.         SetCurrentCamera(2);
  383.         SetCameraFOV(90, 0, 0.0);
  384.         
  385.         # create indy actor
  386.         indy = CreateThing(tplActor, player);
  387.         CaptureThing(indy);
  388.         SetCollideType(indy, 0);
  389.         
  390.         # outfit indy actor
  391.         CopyPlayerHolsters(player, indy);
  392.         
  393.         # hide player show indy
  394.         SetThingFlags(player, 0x80000);
  395.         ClearThingFlags(indy, 0x80000);
  396.         
  397.         # set camera interp speed turn on look interp
  398.         SetCameraInterpSpeed(2, 2.0);
  399.         SetCameraLookInterp(2, 1);
  400.         Sleep(0.01);
  401.         
  402.         # interp to camTargPos2 (looking at statue)
  403.         SetCameraSecondaryFocus(2, camTargPos2);
  404.         
  405.         # indy looks at statue
  406.         AISetLookThing(indy, camTargPos2);
  407.         
  408.         # walk indy closer to statue
  409.         AISetMoveSpeed(indy, 1.0);
  410.         AISetLookThing(indy, but2_walkTarg);
  411.         AISetMoveThing(indy, but2_walkTarg, 0);
  412.         
  413.         # remove collisions
  414.         SetCollideType(statue, 0);
  415.         SetCollideType(base, 0);
  416.         SetCollideType(columnBase, 0);
  417.         Sleep(0.01);
  418.         
  419.         # play move sound fx
  420.         PlaySoundThing(snd_MoveStart, statue, 1.0, 15.0, 25.0, 0);
  421.         loopSound = PlaySoundThing(snd_MoveMove, statue, 1.0, 15.0, 25.0, 1);
  422.             
  423.         # raise base to pos 1
  424.         if((base_Pos == 0) && (statue_Pos == 0))
  425.         {
  426.             MoveThingToPos(base, VectorAdd(GetThingPos(base), '0.0 0.0 0.35'), 3.0);
  427.             base_Pos = 1;
  428.             but1_Ready = 0;
  429.             but3_Ready = 0;
  430.             but4_Ready = 0;
  431.         }
  432.         
  433.         # lower base to pos 0
  434.         else if((base_Pos == 1) && (statue_Pos == 0))
  435.         {
  436.             MoveThingToPos(base, VectorAdd(GetThingPos(base), '0.0 0.0 -0.35'), 3.0);
  437.             base_Pos = 0;
  438.             but1_Ready = 1;
  439.             but3_Ready = 0;
  440.             but4_Ready = 0;
  441.         }
  442.         
  443.         # raise base to pos 1 and statue to pos 2
  444.         else if((base_Pos == 0) && (statue_Pos == 1))
  445.         {
  446.             if((tiki_Moved == 1) && (tiki_Released == 0))
  447.             {
  448.                 # play rotate sound fx
  449.                 PlaySoundThing(snd_RotateStart, statue, 1.0, 15.0, 25.0, 0);
  450.                 rotSound = PlaySoundThing(snd_RotateMove, statue, 1.0, 15.0, 25.0, 1);
  451.                 Rotate(tiki, 90, 1, 3.0);
  452.                 Rotate(statue, 90, 1, 3.0);
  453.                 WaitForStop(statue);
  454.                 StopSound(rotSound, 0.0);
  455.                 PlaySoundThing(snd_RotateStop, statue, 1.0, 15.0, 25.0, 0);
  456.                 tiki_Released = 1;
  457.                 tiki_CanLower = 1;
  458.             }
  459.             
  460.             MoveThingToPos(base, VectorAdd(GetThingPos(base), '0.0 0.0 0.35'), 3.0);
  461.             MoveThingToPos(statue, VectorAdd(GetThingPos(statue), '0.0 0.0 0.35'), 3.0);
  462.             if(tiki_Moved == 1) MoveThingToPos(tiki, VectorAdd(GetThingPos(tiki), '0.0 0.0 0.35'), 3.0);
  463.             statue_Pos = 2;
  464.             base_Pos = 1;
  465.             tiki_Locked = 1;
  466.             but1_Ready = 1;
  467.             but3_Ready = 1;
  468.             but4_Ready = 1;
  469.             done = 0;
  470.         }
  471.         
  472.         # lower base to pos 0 and statue to pos 1
  473.         else if((base_Pos == 1) && (statue_Pos == 2))
  474.         {
  475.             MoveThingToPos(base, VectorAdd(GetThingPos(base), '0.0 0.0 -0.35'), 3.0);
  476.             MoveThingToPos(statue, VectorAdd(GetThingPos(statue), '0.0 0.0 -0.35'), 3.0);
  477.             if(tiki_Moved == 1) MoveThingToPos(tiki, VectorAdd(GetThingPos(tiki), '0.0 0.0 -0.35'), 3.0);
  478.             statue_Pos = 1;
  479.             base_Pos = 0;
  480.             tiki_Locked = 0;
  481.             but1_Ready = 1;
  482.             but3_Ready = 1;
  483.             but4_Ready = 0;
  484.         }
  485.         
  486.         Sleep(3.0);
  487.         StopSound(loopSound, 0.0);
  488.         PlaySoundThing(snd_MoveStop, statue, 1.0, 15.0, 25.0, 0);
  489.         
  490.         # restore collisions
  491.         SetCollideType(statue, 3);
  492.         SetCollideType(base, 3);
  493.         SetCollideType(columnBase, 3);
  494.         
  495.         MoveToFrame(button2, 0, 1.0);
  496.  
  497.         # Get the player into position
  498.         ResetThing(player);
  499.         CopyOrientAndPos(indy, player);
  500.         
  501.         # hide actor show player
  502.         SetThingFlags(indy, 0x80000);
  503.         ClearThingFlags(player, 0x80000);
  504.         DestroyThing(indy);
  505.         
  506.         # restore camera to player
  507.         SetCameraPosition(1, GetThingPos(but2Cam));
  508.         SetCurrentCamera(1);
  509.         RestoreExtCam();
  510.         
  511.         # turn off look interp
  512.         SetCameraLookInterp(2, 0);
  513.     }
  514.     
  515.     # statue can't be moved
  516.     else
  517.     {
  518.         # push in button2
  519.         PlayMode(player, 60, 0);
  520.         Call speak;
  521.         
  522.         # restore camera to player
  523.         SetCameraPosition(1, GetThingPos(but2Cam));
  524.         SetCurrentCamera(1);
  525.         RestoreExtCam();
  526.     }
  527.     
  528.     # restore controls
  529.     ClearActorFlags(player, 0x200000);
  530.     EndCutscene();
  531.     
  532.     playing = 0;
  533.     
  534.     return;
  535.  
  536. # ========================================================================================
  537.  
  538. but3Push:
  539.  
  540.     # do cutscene stuff
  541.     MakeMeStop();
  542.     StartCutscene(2);
  543.     
  544.     # offset camera
  545.     SetExtCamLookOffsetToThing(player);
  546.     SetExtCamOffsetToThing(but3Cam);
  547.         
  548.     # put away any weapon
  549.     DeselectWeaponWait(player);
  550.     
  551.     # statue is in proper position, rotate it
  552.     if(but3_Ready == 1)
  553.     {
  554.         # push in button3
  555.         PlayMode(player, 60, 0);
  556.         Sleep(0.3);
  557.         MoveToFrame(button3, 1, 1.0);
  558.         WaitForStop(button3);
  559.         Sleep(0.5);
  560.         
  561.         # switch to but3Cam
  562.         SetCameraFocus(2, but3Cam);
  563.         SetCameraSecondaryFocus(2, player);
  564.         SetCurrentCamera(2);
  565.         SetCameraFOV(90, 0, 0.0);
  566.         
  567.         # create indy actor
  568.         indy = CreateThing(tplActor, player);
  569.         CaptureThing(indy);
  570.         SetCollideType(indy, 0);
  571.         
  572.         # outfit indy actor
  573.         CopyPlayerHolsters(player, indy);
  574.         
  575.         # hide player show indy
  576.         SetThingFlags(player, 0x80000);
  577.         ClearThingFlags(indy, 0x80000);
  578.         
  579.         # set camera interp speed turn on look interp
  580.         SetCameraInterpSpeed(2, 2.0);
  581.         SetCameraLookInterp(2, 1);
  582.         Sleep(0.01);
  583.         
  584.         # interp to camTargPos1 (looking at statue)
  585.         SetCameraSecondaryFocus(2, camTargPos3);
  586.         
  587.         # indy looks at statue
  588.         AISetLookThing(indy, camTargPos3);
  589.         
  590.         # walk indy closer to statue
  591.         AISetMoveSpeed(indy, 1.0);
  592.         AISetLookThing(indy, but3_walkTarg);
  593.         AISetMoveThing(indy, but3_walkTarg, 0);
  594.         
  595.         # remove collisions
  596.         SetCollideType(statue, 0);
  597.         SetCollideType(base, 0);
  598.         SetCollideType(columnBase, 0);
  599.         Sleep(0.01);
  600.         
  601.         # play rotate sound fx
  602.         PlaySoundThing(snd_RotateStart, statue, 1.0, 15.0, 25.0, 0);
  603.         rotSound = PlaySoundThing(snd_RotateMove, statue, 1.0, 15.0, 25.0, 1);
  604.             
  605.         # rotate tiki to release position
  606.         if((tiki_Locked == 1) && (tiki_Released == 0) && (statue_Pos == 2))
  607.         {
  608.             Rotate(statue, 90, 1, 3.0);
  609.             Rotate(tiki, 90, 1, 3.0);
  610.             tiki_Released = 1;
  611.             tiki_CanLower = 1;
  612.             but4_Ready = 1;
  613.             but1_Ready = 0;
  614.             but2_Ready = 0;
  615.         }
  616.         
  617.         # rotate tiki to locked position
  618.         else if((tiki_Locked == 1) && (tiki_Released == 1) && (statue_Pos == 2))
  619.         {
  620.             Rotate(statue, 90, 1, 3.0);
  621.             Rotate(tiki, 90, 1, 3.0);
  622.             tiki_Released = 0;
  623.             tiki_Moved = 0;
  624.             tiki_CanLower = 0;
  625.             but4_Ready = 1;
  626.             but1_Ready = 1;
  627.             but2_Ready = 1;
  628.         }
  629.         
  630.         else if((tiki_Released == 0) && (statue_Pos == 1))
  631.         {
  632.             Rotate(statue, 90, 1, 3.0);
  633.             if(tiki_CanLower == 1)
  634.             {
  635.                 Rotate(tiki, 90, 1, 3.0);
  636.                 tiki_Released = 1;
  637.             }
  638.             
  639.             else
  640.             {
  641.                 tiki_Released = 0;
  642.                 tiki_CanLower = 0;
  643.             }
  644.             
  645.             but4_Ready = 0;
  646.         }
  647.         
  648.         else if((tiki_Released == 1) && (statue_Pos == 1))
  649.         {
  650.             Rotate(statue, 90, 1, 3.0);
  651.             if(tiki_CanLower == 1)
  652.             {
  653.                 Rotate(tiki, 90, 1, 3.0);
  654.                 tiki_Released = 0;
  655.             }
  656.             
  657.             else
  658.             {
  659.                 tiki_Released = 1;
  660.                 tiki_CanLower = 0;
  661.             }
  662.             
  663.             but4_Ready = 0;
  664.         }
  665.         
  666.         WaitForStop(statue);
  667.         StopSound(rotSound, 0.0);
  668.         PlaySoundThing(snd_RotateStop, statue, 1.0, 15.0, 25.0, 0);
  669.         
  670.         # restore collisions
  671.         SetCollideType(statue, 3);
  672.         SetCollideType(base, 3);
  673.         SetCollideType(columnBase, 3);
  674.         
  675.         MoveToFrame(button3, 0, 1.0);
  676.  
  677.         # Get the player into position
  678.         ResetThing(player);
  679.         CopyOrientAndPos(indy, player);
  680.         
  681.         # hide actor show player
  682.         SetThingFlags(indy, 0x80000);
  683.         ClearThingFlags(player, 0x80000);
  684.         DestroyThing(indy);
  685.         
  686.         # restore camera to player
  687.         SetCameraPosition(1, GetThingPos(but3Cam));
  688.         SetCurrentCamera(1);
  689.         RestoreExtCam();
  690.         
  691.         # turn off look interp
  692.         SetCameraLookInterp(2, 0);
  693.     }
  694.     
  695.     # statue can't be moved
  696.     else
  697.     {
  698.         # push in button3
  699.         PlayMode(player, 60, 0);
  700.         Call speak;
  701.         
  702.         # restore camera to player
  703.         SetCameraPosition(1, GetThingPos(but3Cam));
  704.         SetCurrentCamera(1);
  705.         RestoreExtCam();
  706.     }
  707.     
  708.     # restore controls
  709.     ClearActorFlags(player, 0x200000);
  710.     EndCutscene();
  711.     
  712.     playing = 0;
  713.     
  714.     return;
  715.     
  716. # ========================================================================================
  717.  
  718. but4Push:
  719.  
  720.     # do cutscene stuff
  721.     MakeMeStop();
  722.     StartCutscene(2);
  723.     
  724.     # offset camera
  725.     SetExtCamLookOffsetToThing(player);
  726.     SetExtCamOffsetToThing(but4Cam);
  727.     
  728.     # put away any weapon
  729.     DeselectWeaponWait(player);
  730.     
  731.     # statue is in proper position, move it
  732.     if(but4_Ready == 1)
  733.     {
  734.         but3_Ready = 0;
  735.         
  736.         # push in button4
  737.         PlayMode(player, 60, 0);
  738.         Sleep(0.3);
  739.         MoveToFrame(button4, 1, 1.0);
  740.         WaitForStop(button4);
  741.         Sleep(0.5);
  742.         
  743.         # switch to statue cam
  744.         SetCameraFocus(2, but4Cam);
  745.         SetCameraSecondaryFocus(2, player);
  746.         SetCurrentCamera(2);
  747.         SetCameraFOV(90, 0, 0.0);
  748.         
  749.         # create indy actor
  750.         indy = CreateThing(tplActor, player);
  751.         CaptureThing(indy);
  752.         SetCollideType(indy, 0);
  753.         
  754.         # outfit indy actor
  755.         CopyPlayerHolsters(player, indy);
  756.         
  757.         # hide player show indy
  758.         SetThingFlags(player, 0x80000);
  759.         ClearThingFlags(indy, 0x80000);
  760.         
  761.         # set camera interp speed turn on look interp
  762.         SetCameraInterpSpeed(2, 2.0);
  763.         SetCameraLookInterp(2, 1);
  764.         Sleep(0.01);
  765.         
  766.         # interp to camTargPos4 (looking at statue)
  767.         SetCameraSecondaryFocus(2, camTargPos4);
  768.         
  769.         # indy looks at statue
  770.         AISetLookThing(indy, camTargPos4);
  771.         
  772.         # walk indy closer to statue
  773.         AISetMoveSpeed(indy, 1.0);
  774.         AISetLookThing(indy, but4_walkTarg);
  775.         AISetMoveThing(indy, but4_walkTarg, 0);
  776.         
  777.         # remove collisions
  778.         SetCollideType(statue, 0);
  779.         SetCollideType(base, 0);
  780.         SetCollideType(columnBase, 0);
  781.         Sleep(0.01);
  782.         
  783.         # lower everything to ground level
  784.         if(done == 0)
  785.         {
  786.             # move everything down
  787.             MoveThingToPos(base, VectorAdd(GetThingPos(base), '0.0 0.0 -0.35'), 3.0);
  788.             if(tiki_CanLower == 1) MoveThingToPos(tiki, VectorAdd(GetThingPos(tiki), '0.0 0.0 -0.35'), 3.0);
  789.             MoveThingToPos(statue, VectorAdd(GetThingPos(statue), '0.0 0.0 -0.35'), 3.0);
  790.             
  791.             # play move sound fx
  792.             PlaySoundThing(snd_MoveStart, base, 1.0, 15.0, 25.0, 0);
  793.             loopSound = PlaySoundThing(snd_MoveMove, base, 1.0, 15.0, 25.0, 1);
  794.             Sleep(3.0);
  795.             StopSound(loopSound, 0.0);
  796.             PlaySoundThing(snd_MoveStop, base, 1.0, 15.0, 25.0, 0);
  797.             
  798.             # rotate statue and tiki
  799.             Rotate(statue, -90, 1, 3.0);
  800.             if(tiki_CanLower == 1) Rotate(tiki, -90, 1, 3.0);
  801.             
  802.             # play rotate sound fx
  803.             PlaySoundThing(snd_RotateStart, statue, 1.0, 15.0, 25.0, 0);
  804.             rotSound = PlaySoundThing(snd_RotateMove, statue, 1.0, 15.0, 25.0, 1);
  805.             WaitForStop(statue);
  806.             StopSound(rotSound, 0.0);
  807.             PlaySoundThing(snd_RotateStop, statue, 1.0, 15.0, 25.0, 0);
  808.             
  809.             # move statue and tiki down
  810.             if(tiki_CanLower == 1) MoveThingToPos(tiki, VectorAdd(GetThingPos(tiki), '0.0 0.0 -0.5'), 3.0);
  811.             MoveThingToPos(statue, VectorAdd(GetThingPos(statue), '0.0 0.0 -0.5'), 3.0);
  812.             
  813.             # play move sound fx
  814.             PlaySoundThing(snd_MoveStart, statue, 1.0, 15.0, 25.0, 0);
  815.             loopSound = PlaySoundThing(snd_MoveMove, statue, 1.0, 15.0, 25.0, 1);
  816.             Sleep(3.0);
  817.             StopSound(loopSound, 0.0);
  818.             PlaySoundThing(snd_MoveStop, statue, 1.0, 15.0, 25.0, 0);
  819.             
  820.             done = 1;
  821.             but1_Ready = 1;
  822.             but2_Ready = 1;
  823.             but4_Ready = 0;
  824.             
  825.             statue_Pos = 0;
  826.             base_Pos = 0;
  827.             tiki_Released = 0;
  828.             
  829.             if(tiki_CanLower == 1) tiki_Moved = 1;      # tiki came down
  830.             else tiki_Moved = 0;
  831.         }
  832.         
  833.         SetCollideType(statue, 3);
  834.         SetCollideType(base, 3);
  835.         SetCollideType(columnBase, 3);
  836.         
  837.         MoveToFrame(button4, 0, 1.0);
  838.         
  839.         # Get the player into position
  840.         ResetThing(player);
  841.         CopyOrientAndPos(indy, player);
  842.         
  843.         # hide actor show player
  844.         SetThingFlags(indy, 0x80000);
  845.         ClearThingFlags(player, 0x80000);
  846.         DestroyThing(indy);
  847.         
  848.         # restore camera to player
  849.         SetCameraPosition(1, GetThingPos(but4Cam));
  850.         SetCurrentCamera(1);
  851.         RestoreExtCam();
  852.         
  853.         # turn off look interp
  854.         SetCameraLookInterp(2, 0);
  855.     }
  856.     
  857.     # statue can't be moved
  858.     else
  859.     {
  860.         # push in button4
  861.         PlayMode(player, 60, 0);
  862.         Call speak;
  863.         
  864.         # restore camera to player
  865.         SetCameraPosition(1, GetThingPos(but4Cam));
  866.         SetCurrentCamera(1);
  867.         RestoreExtCam();
  868.     }
  869.     
  870.     # restore controls
  871.     ClearActorFlags(player, 0x200000);
  872.     EndCutscene();
  873.     
  874.     playing = 0;
  875.     
  876.     return;
  877.     
  878. # ========================================================================================
  879.  
  880. getTiki:
  881.     
  882.     # do cutscene stuff
  883.     MakeMeStop();
  884.     StartCutscene(0);
  885.     
  886.     # switch cam
  887.     SetCameraFocus(2, holeCam);
  888.     SetCameraSecondaryFocus(2, target1);
  889.     SetCurrentCamera(2);
  890.     SetCameraFOV(75, 0, 0.0);
  891.     
  892.     # put away any weapon
  893.     DeselectWeaponWait(player);
  894.     
  895.     # create actor indy
  896.     indy = CreateThing(tplActor, player);
  897.     CaptureThing(indy);
  898.     
  899.     # outfit indy actor
  900.     CopyPlayerHolsters(player, indy);
  901.     
  902.     # hide player show actor
  903.     SetThingFlags(player, 0x80000);
  904.     ClearThingFlags(indy, 0x80000);
  905.     
  906.     # pick up the tiki
  907.     PlayKey(indy, inReach, 4, 0x12, 0);
  908.     Sleep(0.4);
  909.     DestroyThing(tiki);
  910.     
  911.     # Call the Pickup Lines cog
  912.     talkCog = GetCogByIndex(0);
  913.     SendMessage(talkCog, 27);
  914.     
  915.     # sleep to wait for talkCog
  916.     Sleep(1.3);
  917.     
  918.     # add tiki2 to inventory
  919.     SetInvAvailable(player, 99, 1);
  920.     ChangeInv(player, 99, 1.0);
  921.     JonesInvItemChanged(99);
  922.     
  923.     # Johnny, tell the player what he's picked up
  924.     PlayVoice(player, say_Tiki, 1.3, 0);
  925.     
  926.     Sleep(1.0);
  927.     
  928.     # solve hint 32
  929.     SendMessage(hint_Cog, user0);
  930.     
  931.     # get player into position
  932.     CopyOrientAndPos(indy, player);
  933.     
  934.     # show player hide indy
  935.     ClearThingFlags(player, 0x80000);
  936.     SetThingFlags(indy, 0x80000);
  937.     
  938.     # restore camera
  939.     SetCurrentCamera(curCam);
  940.     
  941.     # restore controls
  942.     ClearActorFlags(player, 0x200000);
  943.     EndCutscene();
  944.     
  945.     Sleep(2.0);
  946.     
  947.     # turn off camera shake
  948.     SendMessage(cameraShake, user0);
  949.     
  950.     # say what now voice line
  951.     PlayVoice(player, inWhat, 1.0, 0);
  952.     
  953.     # move statue and base to bottom
  954.     MoveThingToPos(statue, VectorAdd(GetThingPos(statue), '0.0 0.0 -0.6'), 2.0);
  955.     MoveThingToPos(base, VectorAdd(GetThingPos(base), '0.0 0.0 -0.6'), 2.0);
  956.     
  957.     # play move sound fx
  958.     PlaySoundThing(snd_MoveStart, statue, 1.0, 15.0, 25.0, 0);
  959.     loopSound = PlaySoundThing(snd_MoveMove, statue, 1.0, 15.0, 25.0, 1);
  960.     Sleep(2.0);
  961.     StopSound(loopSound, 0.0);
  962.     PlaySoundThing(snd_MoveStop, statue, 1.0, 15.0, 25.0, 0);
  963.     
  964.     Sleep(0.5);
  965.     
  966.     # turn off camera shake
  967.     SendMessage(cameraShake, user1);
  968.     
  969.     Sleep(0.5);
  970.     
  971.     return;
  972.  
  973. # ========================================================================================
  974.  
  975. speak:
  976.  
  977.     playing = 1;
  978.     PlayVoice(player, in_Line0, 1.0, 1);
  979.     
  980.     return;
  981.     
  982. # ========================================================================================
  983.  
  984. blocked:
  985.  
  986.     Print("Tiki1Statue: blocked");
  987.  
  988.     return;
  989.     
  990. # ========================================================================================
  991.  
  992. end
  993.  
  994.